home *** CD-ROM | disk | FTP | other *** search
/ Animation / Animation Vol.1 (Profi ROM)(1994).iso / pool / updates / symantec / rtlinc.exe / WINC.H < prev    next >
C/C++ Source or Header  |  1993-06-11  |  4KB  |  138 lines

  1. /*_ winc.h    */
  2. /* Copyright (C) 1985-1993 by Symantec Corp.    */
  3. /* All rights reserved                */
  4.  
  5. #ifndef __WINC_H
  6. #define __WINC_H    1
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #ifndef _INC_WINDOWS
  13. #include <windows.h>
  14. #endif
  15.  
  16. ///////////////////////////////////////////////// WINC
  17. #ifdef __SC__
  18. /*
  19.  This section modified by DAM - 6/16/91 to fix macros and C function
  20.  definitions and to ensure that the macros and C functions are defined
  21.  for both C *and* C++. Also added new functions to set a font for StdIO
  22.  
  23.  It has been moved from the Windows 3.0 header to this 3.1 header for
  24.  consistency but really has no business being here and should be elsewhere.(TL)
  25. */
  26.  
  27. typedef unsigned short (* __pascal Hook_t)(char __far *,unsigned short,unsigned short);
  28.  
  29. extern int winc_startmode;
  30.  
  31. typedef struct TSTDIO
  32.   {
  33.   unsigned short    X;
  34.   unsigned short    Y;
  35.   HWND        HWnd;
  36.   HWND        PrevHWnd;
  37.   HDC        HDc;
  38.   unsigned short    TextXSize;
  39.   unsigned short    TextYSize;
  40.   POINT        Size;        // only Y field is valid
  41.   POINT        Scroll;        // only Y field is valid
  42.   HBRUSH    SolidBrush;
  43.   HFONT        Font;
  44.   RECT        ClientRect;
  45.   RECT        BottomLineRect;
  46.   Hook_t    HookFunction;
  47.   }
  48. StdIO_t;
  49.  
  50. #define TAB_FLG 2
  51. #define RET_FLG 1
  52.  
  53. #define StdOutSet(A)     StdIOSet(&StdOutW,A)
  54. #define StdErrSet(A)     StdIOSet(&StdErrW,A)
  55. #define StdOutGet()      StdIOGet(&StdOutW)
  56. #define StdErrGet()      StdIOGet(&StdErrW)
  57. #define StdOutRelease()  StdIORelease(&StdOutW)
  58. #define StdErrRelease()  StdIORelease(&StdErrW)
  59. #define StdOutHookSet(A) StdIOHook(&StdOutW,A)
  60. #define StdErrHookSet(A) StdIOHook(&StdErrW,A)
  61. #define StdOutHookGet()  StdIOHook(&StdOutW)
  62. #define StdErrHookGet()  StdIOHook(&StdErrW)
  63. #define StdOutClear()    StdIOClear(&StdOutW)
  64. #define StdErrClear()    StdIOClear(&StdErrW)
  65. #define StdOutFontSet(A)  StdIOFontSet(StdOutW,A)
  66. #define StdErrFontSet(A)  StdIOFontSet(StdErrW,A)
  67. #define StdOutFontGet(A)  StdIOFontGet(StdOutW)
  68. #define StdErrFontGet(A)  StdIOFontGet(StdErrW)
  69.  
  70. #ifndef NOMSG
  71. void   __pascal MessageFatalError(char __far *);
  72. void   __pascal MessageLoop(MSG __far *);
  73. #endif
  74.  
  75. #ifdef __cplusplus
  76.  
  77. void   __pascal StdIOSet(class StdIOC *,HWND);
  78. unsigned short __pascal StdIOGet(class StdIOC *);
  79. void   __pascal StdIORelease(class StdIOC *);
  80. void   __pascal StdIOHookSet(class StdIOC *,Hook_t);
  81. Hook_t __pascal StdIOHookGet(class StdIOC *);
  82. void   __pascal StdIOClear(class StdIOC *);
  83. void   __pascal StdIOFontSet(class StdIOC *, HFONT);
  84. HFONT  __pascal StdIOFontGet(class StdIOC *);
  85.  
  86. class StdIOC
  87.   {
  88.   protected:
  89.  StdIO_t   h;
  90.  
  91.   public:
  92.     void       Set(HWND x)        { StdIOSet(this,x); }
  93.   unsigned short   Get(void)          { return StdIOGet(this); }
  94.     void       Release(void)      { StdIORelease(this); }      
  95.     void       HookSet(Hook_t x)  { StdIOHookSet(this,x); }
  96.   Hook_t       HookGet(void)      { return StdIOHookGet(this); }
  97.   unsigned short   LineCountGet(void) { return h.Size.y/h.TextYSize; }
  98.     void       CursorSet(unsigned short x,unsigned short y) { h.X = x; h.Y = y; }
  99.     void       FontSet(HFONT f)   { StdIOFontSet(this,f); }
  100.   HBRUSH       BrushBackGroundGet(void)     { return h.SolidBrush; }
  101.     RECT      *ClientRectGet(void)          { return &h.ClientRect; }
  102.     RECT      *BottomLineRectGet(void)      { return &h.BottomLineRect; }
  103.     HWND       WndGet(void)       { return h.HWnd; }
  104.    HFONT       FontGet(void)      { return h.Font; }
  105.   unsigned short   TextXGet(void)     { return h.TextXSize; }
  106.   unsigned short   TextYGet(void)     { return h.TextYSize; }
  107.   unsigned short   SizeYGet(void)     { return h.Size.y; }
  108.     void       Clear(void)        { StdIOClear(this); }
  109.   };
  110.  
  111. extern StdIOC   StdOutW;
  112. extern StdIOC   StdErrW;
  113.  
  114. #else
  115.  
  116. void   __pascal StdIOSet(StdIO_t *,HWND);
  117. unsigned short __pascal StdIOGet(StdIO_t *);
  118. void   __pascal StdIORelease(StdIO_t *);
  119. void   __pascal StdIOHookSet(StdIO_t *,Hook_t);
  120. Hook_t __pascal StdIOHookGet(StdIO_t *);
  121. void   __pascal StdIOClear(StdIO_t *);
  122. void   __pascal StdIOFontSet(StdIO_t *, HFONT);
  123. HFONT  __pascal StdIOFontGet(StdIO_t *);
  124.  
  125. extern StdIO_t   StdOutW;
  126. extern StdIO_t   StdErrW;
  127.  
  128. #endif  /* cplusplus */
  129. #endif  /* _SC_ */
  130.  
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134.  
  135. #endif /* __WINC_H */
  136.  
  137.  
  138.